﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace rock.UI.common
{
    public static class Constant
    {
        #region  系统默认用户
        /// <summary>
        /// 系统默认用户
        /// </summary>
        public const string SYSTEM_DEFAULT_ACCOUNT = "admin";
        #endregion  系统默认用户

        #region  合同状态
        /// <summary>
        /// 生效 1
        /// </summary>
        public   const int RENT_CONTRACT_STATUS_SHENGXIAO = 1;
        /// <summary>
        /// 终止 2
        /// </summary>
        public   const int RENT_CONTRACT_STATUS_DONGZHI = 2;
        /// <summary>
        /// 废除 3
        /// </summary>
        public   const int RENT_CONTRACT_STATUS_FEICHU = 3;



        public static List<ComboBoxInfo> RENT_CONTRACT_STATUS_LIST =  INITS_RENT_CONTRACT_STATUS_LIST();
        public static List<ComboBoxInfo> INITS_RENT_CONTRACT_STATUS_LIST()
        {
            RENT_CONTRACT_STATUS_LIST = new List<ComboBoxInfo>();
            RENT_CONTRACT_STATUS_LIST.Add(new ComboBoxInfo() { IntId = RENT_CONTRACT_STATUS_SHENGXIAO , Id = RENT_CONTRACT_STATUS_SHENGXIAO + "", Name = "生效" });
            RENT_CONTRACT_STATUS_LIST.Add(new ComboBoxInfo() { IntId = RENT_CONTRACT_STATUS_DONGZHI, Id = RENT_CONTRACT_STATUS_DONGZHI + "", Name = "终止" });
            RENT_CONTRACT_STATUS_LIST.Add(new ComboBoxInfo() { IntId = RENT_CONTRACT_STATUS_FEICHU,     Id = RENT_CONTRACT_STATUS_FEICHU + "", Name = "废除" });
            return RENT_CONTRACT_STATUS_LIST;
        }


        public static ComboBoxInfo getByContractStatus(int status) 
        {
            foreach (ComboBoxInfo item in RENT_CONTRACT_STATUS_LIST)
            {
                if (item.IntId == status) {
                    return item;
                }
            }
            return new ComboBoxInfo();

        }
        
        #endregion  合同状态
      
        #region 房屋状态

        /// <summary>
        /// 未出租 0
        /// </summary>
        public   const int HOUSE_ROOM_STATUS_UNRENT = 0;
        /// <summary>
        /// 已出租 1 
        /// </summary>
        public   const int HOUSE_ROOM_STATUS_RENTED = 1;
        /// <summary>
        /// 已预定 2
        /// </summary>
        public   const int HOUSE_ROOM_STATUS_YUDING = 2;
        /// <summary>
        /// 暂停出租  3
        /// </summary>
        public   const int HOUSE_ROOM_STATUS_PAUSE = 3;
        /// <summary>
        /// 暂未录入房间资料  -1
        /// </summary>
        public const int HOUSE_ROOM_STATUS_NORECORD = -1;

        /// <summary>
        ///程序未设置HOUSE_CODE  -2
        /// </summary>
        public const int HOUSE_ROOM_STATUS_NOHOUSE_CODE = -2;


        public static List<ComboBoxInfo> HOUSE_ROOM_STATUS_LIST = INITS_HOUSE_ROOM_STATUS_LIST();
        public static List<ComboBoxInfo> INITS_HOUSE_ROOM_STATUS_LIST()
        {
            HOUSE_ROOM_STATUS_LIST = new List<ComboBoxInfo>();
            HOUSE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = HOUSE_ROOM_STATUS_UNRENT, Id = HOUSE_ROOM_STATUS_UNRENT + "", Name = "未出租" });
            HOUSE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = HOUSE_ROOM_STATUS_RENTED, Id = HOUSE_ROOM_STATUS_RENTED + "", Name = "正在出租" });
            //HOUSE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = HOUSE_ROOM_STATUS_YUDING, Id = HOUSE_ROOM_STATUS_YUDING + "", Name = "已预定" });
            HOUSE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = HOUSE_ROOM_STATUS_PAUSE, Id = HOUSE_ROOM_STATUS_PAUSE + "", Name = "暂停出租" });
            return HOUSE_ROOM_STATUS_LIST;
        }
        public static ComboBoxInfo getByRoomStatus(int status)
        {
            foreach (ComboBoxInfo item in HOUSE_ROOM_STATUS_LIST)
            {
                if (item.IntId == status)
                {
                    return item;
                }
            }
            return new ComboBoxInfo();

        }

        #endregion 房屋状态

        #region 押金状态
       

        /// <summary>
        /// 已收
        /// </summary>
        public const int FEE_YAJIN_STATUS_YISHAO= 1;
        /// <summary>
        /// 已退
        /// </summary>
        public const int FEE_YAJIN_STATUS_YITEI = 2;
        /// <summary>
        /// 已退部份
        /// </summary>
        public const int FEE_YAJIN_STATUS_YITEIBUFENG = 3;
        /// <summary>
        /// 免收
        /// </summary>
        public const int FEE_YAJIN_STATUS_BUSHAO = -1;

        public static List<ComboBoxInfo> FEE_YAJIN_STATUS_LIST = INITS_FEE_YAJIN_STATUS_LIST();
        public static List<ComboBoxInfo> INITS_FEE_YAJIN_STATUS_LIST()
        {
            FEE_YAJIN_STATUS_LIST = new List<ComboBoxInfo>();
            
            FEE_YAJIN_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_YAJIN_STATUS_YISHAO, Id = FEE_YAJIN_STATUS_YISHAO + "", Name = "已收款" });
            FEE_YAJIN_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_YAJIN_STATUS_YITEI, Id = FEE_YAJIN_STATUS_YITEI + "", Name = "已退全款" });
            FEE_YAJIN_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_YAJIN_STATUS_YITEIBUFENG, Id = FEE_YAJIN_STATUS_YITEIBUFENG + "", Name = "已退部份款" });
            FEE_YAJIN_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_YAJIN_STATUS_BUSHAO, Id = FEE_YAJIN_STATUS_BUSHAO + "", Name = "免收款" });
            return FEE_YAJIN_STATUS_LIST;
        }


        public static ComboBoxInfo getByYajingStatus(int status)
        {
            foreach (ComboBoxInfo item in FEE_YAJIN_STATUS_LIST)
            {
                if (item.IntId == status)
                {
                    return item;
                }
            }
            return new ComboBoxInfo();

        }

 
        #endregion 押金状态

        #region 费用类型
        /// <summary>
        /// 按量
        /// </summary>
        public const int FEE_TYPE_COUNT = 1;
        /// <summary>
        /// 按面积
        /// </summary>
        public const int FEE_TYPE_SIZE = 2;
        /// <summary>
        /// 按次
        /// </summary>
        public const int FEE_TYPE_ANCHI = 3;


        public static List<ComboBoxInfo> FEE_FEE_TYPE_LIST = INITS_FEE_TYPE_LIST();
        public static List<ComboBoxInfo> INITS_FEE_TYPE_LIST()
        {
            FEE_FEE_TYPE_LIST = new List<ComboBoxInfo>();
            FEE_FEE_TYPE_LIST.Add(new ComboBoxInfo() { IntId = FEE_TYPE_COUNT, Id = FEE_TYPE_COUNT + "", Name = "按量" });
            FEE_FEE_TYPE_LIST.Add(new ComboBoxInfo() { IntId = FEE_TYPE_SIZE, Id = FEE_TYPE_SIZE + "", Name = "按面积" });
            FEE_FEE_TYPE_LIST.Add(new ComboBoxInfo() { IntId = FEE_TYPE_ANCHI, Id = FEE_TYPE_ANCHI + "", Name = "按次" });
            return FEE_FEE_TYPE_LIST;
        }


        public static ComboBoxInfo getByFeeTypeStatus(int status)
        {
            foreach (ComboBoxInfo item in FEE_FEE_TYPE_LIST)
            {
                if (item.IntId == status)
                {
                    return item;
                }
            }
            return new ComboBoxInfo();

        }

        #endregion 费用类型

        #region 房租状态
        /// <summary>
        /// 本次未收款
        /// </summary>
        public const int FEE_ROOM_WEISHAO = 0;
        /// <summary>
        /// 本次已收完
        /// </summary>
        public const int FEE_ROOM_YISHAO = 1;
        /// <summary>
        /// 本次只收部份
        /// </summary>
        public const int FEE_ROOM_YISHAOBUFENG = 2;

        /// <summary>
        /// 本次不收款
        /// </summary>
        public const int FEE_ROOM_BUSHAO =-1;


        public static List<ComboBoxInfo> FEE_ROOM_STATUS_LIST = INITS_FEE_ROOM_STATUS_LIST();
        public static List<ComboBoxInfo> INITS_FEE_ROOM_STATUS_LIST()
        {
            FEE_ROOM_STATUS_LIST = new List<ComboBoxInfo>();
            FEE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_WEISHAO, Id = FEE_ROOM_WEISHAO + "", Name = "待收款" });
            FEE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_YISHAO, Id = FEE_ROOM_YISHAO + "", Name = "已收全款" });
            FEE_ROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_YISHAOBUFENG, Id = FEE_ROOM_YISHAOBUFENG + "", Name = "已收部份款" });
            return FEE_ROOM_STATUS_LIST;
        }
        public static List<ComboBoxInfo> FEE_OTHERROOM_STATUS_LIST = INITS_OTHERFEE_ROOM_STATUS_LIST();
        public static List<ComboBoxInfo> INITS_OTHERFEE_ROOM_STATUS_LIST()
        {
            FEE_OTHERROOM_STATUS_LIST = new List<ComboBoxInfo>();
            FEE_OTHERROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_WEISHAO, Id = FEE_ROOM_WEISHAO + "", Name = "待收款" });
            FEE_OTHERROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_YISHAO, Id = FEE_ROOM_YISHAO + "", Name = "已收全款" });
            FEE_OTHERROOM_STATUS_LIST.Add(new ComboBoxInfo() { IntId = FEE_ROOM_BUSHAO, Id = FEE_ROOM_BUSHAO + "", Name = "免收款" });
            return FEE_OTHERROOM_STATUS_LIST;
        }


        public static ComboBoxInfo getByFeeStatus(int status)
        {
            foreach (ComboBoxInfo item in FEE_ROOM_STATUS_LIST)
            {
                if (item.IntId == status)
                {
                    return item;
                }
            }
            return new ComboBoxInfo();

        }

        #endregion 房租状态

        #region 租户类型
        /// <summary>
        /// 个人
        /// </summary>
        public const int CUSTOM_TYPE_GEREN = 0;
        /// <summary>
        /// 商户
        /// </summary>
        public const int CUSTOM_TYPE_SHANGHU = 1;

        #endregion 租户类型


        #region 验证有效性
        public const string CHECK_LAST_STARTUP_DATE = "database";
        public const string CHECK_INSTART_DATE = "database2"; 
        #endregion 验证有效性
    }
}
